package com.atguigu.gmall.order.rest;

import com.atguigu.gmall.order.biz.OrderBizService;
import com.atguigu.gmall.order.vo.OrderSplitChildVo;
import com.atguigu.gmall.order.vo.OrderSplitVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:lyd
 * @Date:2023/9/10 10:05
 * @Version:1.0
 * @Description 处理
 **/
@RestController
@RequestMapping("/api/order")
public class OrderSplitRestController {

    @Autowired
    OrderBizService orderBizService;
    /**
     *处理库存系统发起的拆单请求
     * @param orderSplitVo
     * @return
     */
    @PostMapping("/orderSplit")
    public List<OrderSplitChildVo> orderSplit (OrderSplitVo orderSplitVo){
        List<OrderSplitChildVo> childVos = orderBizService.splitOrder(orderSplitVo);
        return childVos;
    }

}
